package com.sinochem.yunlian.ship.base.mapper;

import com.sinochem.yunlian.ship.base.entity.BsMaterialCategory;
import com.sinochem.yunlian.ship.base.vo.response.RespMaterialCategoryLeveVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 货品基础信息表
 * 
 * @author wh
 * @email ${email}
 * @date 2017-11-21 19:06:25
 */
public interface BsMaterialCategoryMapper extends Mapper<BsMaterialCategory> {

    List<BsMaterialCategory> findAllMaterialCategory();

    String getBsMaterialCategoryList(Long id);

    List<BsMaterialCategory> findMaterialCategoryByCondition(Map param);

    List<BsMaterialCategory> findByLevel();

    /**
     * @Description: 获取货品等级列表
     */
	ArrayList<RespMaterialCategoryLeveVo> selectMaterialLevelList(@Param("level") Integer level, @Param("parentId") Long parentId);
	/**
	 * @Description: 获取货品列表
	 */
	List<BsMaterialCategory> selectMaterialList(@Param("parentId") Long parentId, @Param("categoryName")String keyWord);
	/**
	 * 
	 * @param lists 
	 * @Description: 更新DisableStatus
	 */
	int updateMaterialDisableStatus(@Param("id") Long id, @Param("disableStatus") Integer disableStatus, @Param("ids") List<Long> lists);
	/**
	 * 
	 * @Description: 根据ID获取未删除的
	 */
	BsMaterialCategory selectMaterialById(@Param("id") Long id);
	/**
	 * 
	 * @Description: 获取最大的等级
	 */
	int selectMaterialMaxLevel();
	/**
	 * 
	 * @Description: 获取最大的排序序号
	 */
	int selectMaterialMaxSeqNum();
	/**
	 * 
	 * @param parentId
	 * @Description: 获取当前节点最大编码
	 */
	String selectMaterialMaxEnName(@Param("parentId") Long parentId);
	/**
	 * 
	 * @Description: 获取父节点的所有子节点
	 */
	List<BsMaterialCategory> selectMaterialCategoryList(@Param("parentId") Long parentId);

    List<BsMaterialCategory> findMaterialCategoryListByMap(Map param);
    /**
     * 
     * @Description: 根据货品id查询EnName
     */
	String selectMaterialMaxEnNameById(@Param("id") Long id);
	/**
	 * 
	 * @Description: 查询货品名称以及等级查询货品
	 */
	BsMaterialCategory selectMaterialByCategoryNameAndLevel(@Param("categoryName")String categoryName, @Param("level")int level);

}
